﻿class crl.site {
	static var cbg:MovieClip;
	static var setBG:MovieClip;
	static var HeadColor;
	function site() {
	}
	static function cBG(bgParent:MovieClip) {
		cbg = bgParent.createEmptyMovieClip("cbg", 1);
		setBG = bgParent.createEmptyMovieClip("setBG", 3);
		with (cbg) {
			//lineStyle(1, 0xcccccc, 100);
			beginFill(0xf7f7f0, 100);
			moveTo(0-Stage.width/2, 0-Stage.height/2);
			lineTo(Stage.width/2, 0-Stage.height/2);
			lineTo(Stage.width/2, Stage.height/2);
			lineTo(0-Stage.width/2, Stage.height/2);
			endFill();
		}
		cbg._x = Stage.width/2;
		//影片X位置
		cbg._y = Stage.height/2;
		//影片Y位置
		setBG._x = Stage.width-120;
		setBG._y = Stage.height-35;
		setBG.loadMovie("Plus/Default/setBgColor.swf");
		bgParent.bg.swapDepths(2);
	}
	static function CMenu(menuP:MovieClip, xml:XML) {
		var menu:MovieClip = menuP.createEmptyMovieClip("menu", menuP.getNextHighestDepth());
		var o:Object = new Object();
		var loader:MovieClipLoader = new MovieClipLoader();
		o.onLoadInit = function(evt:MovieClip) {
			evt.checkLoad(xml);
			trace("hello")
		};
		loader.addListener(o);
		loader.loadClip("Plus/Default/menu.swf", menu);
	}
	static function resize() {
		cbg._width = Stage.width;
		cbg._height = Stage.height;
		cbg._x = Stage.width/2;
		//影片X位置
		cbg._y = Stage.height/2;
		setBG._x = Stage.width-120;
		setBG._y = Stage.height-35;
	}
	static function setColor(color:String) {
		HeadColor = "0x"+color;
		_global.hc = HeadColor;
		var myColor:Color = new Color(cbg);
		myColor.setRGB(HeadColor);
		for (var i = 0; i<_level0.arr.length; i++) {
			var myColor:Color = new Color(_level0.arr[i]._mc.head.head);
			myColor.setRGB(HeadColor);
		}
	}
}
